package com.foreknow.oop;

public class Test {
  public static void main(String[] args) {
//    String a = new String("tom");
//    int aa = 1;
    //创建了Studernt类的对象（注意：创建对象一要使用new）
    Student zhangsan = new Student(); //对象就是一个具体学生
    zhangsan.name = "张三";
    zhangsan.sex = "男";
    zhangsan.age = 40;
    zhangsan.school = "中国人民大学";

    System.out.println(zhangsan.name);
    System.out.println(zhangsan.sex);
    System.out.println(zhangsan.age);
    System.out.println(zhangsan.school);

    zhangsan.eat();
    zhangsan.study();
    zhangsan.sleep();

    System.out.println("------------------------------------");

    Student lisi = new Student(); //对象就是一个具体学生
    lisi.name = "李四";
    lisi.sex = "女";
    lisi.age = 20;
    lisi.school = "不上学";

    System.out.println(lisi.name);
    System.out.println(lisi.sex);
    System.out.println(lisi.age);
    System.out.println(lisi.school);

    lisi.eat();
    lisi.study();
    lisi.sleep();

    System.out.println("------------------------------------");

    Student wangwu = new Student();
    System.out.println(wangwu.name);
    System.out.println(wangwu.sex);
    System.out.println(wangwu.age);
    System.out.println(wangwu.school);
    System.out.println(wangwu);


  }
}
